package part1.api.exception.exceptiontest;

import java.io.FileOutputStream;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始");

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("./a/b/dos.txt");
        } catch (Exception e) {
            System.out.println("抓捕异常并解决了");
        } finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("关闭流抓捕了异常并解决了");
            }
        }

        System.out.println("程序结束");
    }
}
